﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace DevExpress.MailClient.Win.Forms
{
    public partial class FILE_FOLDER_STRUCTURE_SELECTION : PRO_DOCS.BLL.WIN.Templates.DevxConfigurationTemplate
    {
        public string NEW_FILE_DISPLAY_NAME
        {
            get
            {
                return txtFileName.Text;
            }
        }

        public FILE_FOLDER_STRUCTURE_SELECTION
            (
            bool isEditable,
            PRO_DOCS.DAL.Database.ARCHIVE_DEPARTMENT_FILE _aRCHIVE_DEPARTMENT_FILE)
        {
            InitializeComponent();

            btnDeleteItem.Visibility = XtraBars.BarItemVisibility.Never;
            btnAddNew.Visibility = XtraBars.BarItemVisibility.Never;
            btnSaveUpdate.ItemClick += btnSaveUpdate_ItemClick;

            ucFolderStructureTree1.CURRENT_SELECTED_VIEW_MODE = ucFolderStructureTree.FolderStructureViewModes.FileCopyingSelection;

            ucFolderStructureTree1.BUILD_ARCHIVE_DEPARTMENT_FOLDER_STRUCTURE();

            txtFileName.Text = _aRCHIVE_DEPARTMENT_FILE.ARCHIVE_DEPARTMENT_FILE_DISPLAY_NAME;

            txtFileName.Enabled = isEditable;
        }

        void btnSaveUpdate_ItemClick(object sender, XtraBars.ItemClickEventArgs e)
        {
            this.DialogResult = System.Windows.Forms.DialogResult.OK;
        }

        public PRO_DOCS.DAL.Database.ARCHIVE_DEPARTMENTS_FOLDERS_STRUCTURE CURRENT_SELECTED_FILE_FOLDER_STRUCTURE_SELECTION
        {
            get
            {
                return ucFolderStructureTree1.CURRENT_SELECTED_ARCHIVE_DEPARTMENTS_FOLDERS_STRUCTURE;
            }
        }
    }
}